<script type="text/javascript">
var dragobject={
z: 0, x: 0, y: 0, offsetx : null, offsety : null, targetobj : null, dragapproved : 0,
initialize:function(){
document.onmousedown=this.drag
document.onmouseup=function(){this.dragapproved=0}
},
drag:function(e){
var evtobj=window.event? window.event : e
this.targetobj=window.event? event.srcElement : e.target
if (this.targetobj.className=="drag"){
this.dragapproved=1
if (isNaN(parseInt(this.targetobj.style.left))){this.targetobj.style.left=0}
if (isNaN(parseInt(this.targetobj.style.top))){this.targetobj.style.top=0}
this.offsetx=parseInt(this.targetobj.style.left)
this.offsety=parseInt(this.targetobj.style.top)
this.x=evtobj.clientX
this.y=evtobj.clientY
if (evtobj.preventDefault)
evtobj.preventDefault()
document.onmousemove=dragobject.moveit
}
},
moveit:function(e){
var evtobj=window.event? window.event : e
if (this.dragapproved==1){
this.targetobj.style.left=this.offsetx+evtobj.clientX-this.x+"px"
//document.writeln(this.targetobj.offsetLeft)
if (this.targetobj.offsetLeft > 1000) {
	this.targetobj.style.visibility ="hidden"
}

if (this.targetobj.offsetLeft < 0) {
	this.targetobj.style.visibility ="hidden"
}

//this.targetobj.style.top=this.offsety+evtobj.clientY-this.y+"px"
return false
}
}
}

dragobject.initialize()

</script>	
	



<?php

include_once('listadoDeRss.php');

 $diario = $_GET['diario'];
 
 echo "<p><a class='diario'>" . $vector_diarios[$diario]. "</a></p>";
 echo "<p>&nbsp;  </p>";


$rss =  simplexml_load_file($vector_rss[$diario]);

 

 $cnt = 0;
$totalDeNoticias = count($rss->channel->item);

foreach ($rss->channel->item as $item) {
 
 
 
 if ($cnt == 0) {
 
	 echo "<div class='drag' id='paginas' name='" . $cnt . "'>";
	 
	 echo "<p><a class='titulares' href='" . $item->link . "'>" . $item->title . "</a></p>";
	 echo "<p><a class='descripcion'>" . strip_tags($item->description) . "</a></p>";
	 echo "<p>&nbsp;</p>";
		 if ($cnt == $totalDeNoticias) {
		
		echo "</div>";
	 } 

 }
 
 
 
 if ($cnt % 5 == 0 && $cnt != 0) {
 
 
	 
	 echo "</div>";
	 echo "<div <div class='drag' id='paginas' name='" . $cnt . "'>";
	
	 echo "<p><a class='titulares' href='" . $item->link . "'>" . $item->title . "</a></p>";
	 echo "<p><a class='descripcion'>" . strip_tags($item->description) . "</a></p>";
	 echo "<p>&nbsp;</p>";
	
	   if ($cnt == $totalDeNoticias-1) {
		
		echo "</div>";
	 }
 
 }
 
if ($cnt % 5 != 0 && $cnt != 0) {
	 echo "<p><a class='titulares' href='" . $item->link . "'>" . $item->title . "</a></p>";
	 echo "<p><a class='descripcion'>" . strip_tags($item->description) . "</a></p>";
	 echo "<p>&nbsp;</p>";
	  if ($cnt == $totalDeNoticias-1) {
		
		echo "</div>";
	 }
 }
}